export function is(val: unknown, type: string) {
  return toString.call(val) === `[object ${type}]`;
}

export const isFunction = (val: unknown): boolean => typeof val === 'function';

export function isString(val: unknown): val is string {
  return is(val, 'String');
}

export const isObject = (val: any): val is Record<any, any> => {
  return val !== null && is(val, 'Object');
};
